﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Collections.ObjectModel;
using Garlic.DM.DataModel;


namespace Garlic.WcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IServiceForSL" in both code and config file together.
    [ServiceContract]
    public interface IServiceForSL
    {
        [OperationContract]
        void DoWork();

        [OperationContract]
        string GetCustomerName(int temUserID);

        /// <summary>
        /// 根据用户ID，类型获得主航线。
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="userType"></param>
        /// <returns></returns>
        [OperationContract]
        List<MainSeaRoutes> GetMainSeaRoutes_ByUserId(int userID, string userType);

        /// <summary>
        /// 根据用户ID，类型、主航线获得此航线下所有的子航线。
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="userType"></param>
        /// <param name="sln_srt_id"></param>
        /// <returns></returns>
        [OperationContract]
        List<MainSeaRoutes> GetChildSeaRoutes_ByLineID(int userID, string userType, int sln_srt_id);

        /// <summary>
        /// 得到班期
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="serviceLineID"></param>
        /// <returns></returns>
        [OperationContract]
        List<MainSeaRoutes> GetVesselDate(int userid, string serviceLineID);

        /// <summary>
        /// 显示预分码头
        /// </summary>
        /// <param name="flt_sln_id"></param>
        /// <returns></returns>
        [OperationContract]
        List<MainSeaRoutes> GetTermail(int flt_sln_id);

        /// <summary>
        /// 显示预分码头
        /// </summary>
        /// <param name="flt_sln_id"></param>
        /// <returns></returns>
        [OperationContract]
        List<MainSeaRoutes> GetTermail_Schedule(int flt_sln_id, int flt_id);

        /// <summary>
        /// 显示船名
        /// </summary>
        /// <param name="sln_id"></param>
        /// <returns></returns>
        [OperationContract]
        string GetVesselName(int sln_id);

        /// <summary>
        /// 得到船期表数据。
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<UM_VesselSchedules> GetVesselSchedules(string whereStr, string orderByStr);
        //List<Garlic.DM.DataModel.UM_VesselSchedules> GetVesselSchedules();

        /// <summary>
        /// 得到船期靠泊数据。
        /// </summary>
        /// <param name="SCD_ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Vessel_Berthes> GetVesselBerthes(decimal SCD_ID);

        /// <summary>
        /// 得到船期航次数据。
        /// </summary>
        /// <param name="SCD_ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Voyages> GetVoyages(decimal SCD_ID);

        /// <summary>
        /// 船期的集装箱箱量。
        /// </summary>
        /// <param name="SCD_ID"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Voyage_Amounts> GetVoyageAmounts(decimal SCD_ID);

        /// <summary>
        /// 航次的集装箱箱量。
        /// </summary>
        /// <param name="txtWhere"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Voyage_Amounts> GetVoyageAmounts_CTNAmount(string txtWhere);

        /// <summary>
        /// 得到所有船名
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<ST_Vessels> GetAllVessels(string txtWhere, string txtOrder);

        /// <summary>
        ///  得到所有码头代码。
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<UM_Terminals> GetAllTerminalls();

        /// <summary>
        /// 得到配置表里的数据。
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<UM_Ref_Code> GetRefCode(string txtWhere, string txtOrder);

        /// <summary>
        /// 获取所有港口的信息。
        /// </summary>
        /// <param name="txtWhere"></param>
        /// <param name="txtOrder"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Ports> GetAllPort(string txtWhere, string txtOrder);

        /// <summary>
        /// 写入将船期计划写入schedule表。
        /// </summary>
        /// <param name="user_id"></param>
        /// <param name="cnname"></param>
        /// <param name="enname"></param>
        /// <param name="ivoyage"></param>
        /// <param name="evoyage"></param>
        /// <param name="eta"></param>
        /// <param name="etd"></param>
        /// <param name="state"></param>
        /// <param name="ter_id"></param>
        /// <param name="culoc"></param>
        /// <param name="pilotage"></param>
        /// <param name="fid"></param>
        /// <param name="nid"></param>
        /// <param name="sln_id"></param>
        /// <param name="flt_id"></param>
        /// <returns></returns>
        [OperationContract]
        string InsertToTable_Schedule(string user_id, string cnname, string enname, string ivoyage, string evoyage, DateTime eta, DateTime etd, string state, string ter_id, string culoc, string pilotage, string fid, string nid, string sln_id, string flt_id, string vsl_code);

        [OperationContract]
        string DeleteBySCD_ID(string scd_id);

        /// <summary>
        /// 得到一个船期。
        /// </summary>
        /// <param name="scd_id"></param>
        /// <returns></returns>
        [OperationContract]
        ST_Schedules GetScheduleBy_SCD_ID(string scd_id);

        /// <summary>
        /// 得到服务航线
        /// </summary>
        /// <param name="sln_id"></param>
        /// <returns></returns>
        [OperationContract]
        ST_SERVICE_LINES GetService_LinesBySLN_ID(string sln_id);

        /// <summary>
        /// 更新班期。
        /// </summary>
        /// <param name="user_id"></param>
        /// <param name="cnname"></param>
        /// <param name="enname"></param>
        /// <param name="ivoyage"></param>
        /// <param name="evoyage"></param>
        /// <param name="eta"></param>
        /// <param name="etd"></param>
        /// <param name="state"></param>
        /// <param name="ter_id"></param>
        /// <param name="culoc"></param>
        /// <param name="pilotage"></param>
        /// <param name="fid"></param>
        /// <param name="nid"></param>
        /// <param name="sln_id"></param>
        /// <param name="flt_id"></param>
        /// <returns></returns>
        [OperationContract]
        string UpdateSchedule(string scd_id, string user_id, string cnname, string enname, string ivoyage, string evoyage, DateTime eta
           , DateTime etd, string state, string ter_id, string culoc, string pilotage, string fid, string nid, string flt_id,string vsl_code);
        /// <summary>
        /// 新增修改靠泊表 P_Operation_Type为1是新增，2是修改
        /// </summary>
        /// <param name="scd_id"></param>
        /// <param name="user_id"></param>
        /// <param name="cnname"></param>
        /// <param name="enname"></param>
        /// <param name="ivoyage"></param>
        /// <param name="evoyage"></param>
        /// <param name="eta"></param>
        /// <param name="etd"></param>
        /// <param name="state"></param>
        /// <param name="ter_id"></param>
        /// <returns></returns>
        [OperationContract]
        string InsertUpdateVesselBerth(int P_Operation_Type, string p_SCD_ID, DateTime P_VBT_PBTHDT, DateTime P_VBT_PDPTDT,
                   string P_VBT_PBTHDRAFT, string P_VBT_PBTHDRAFT_P, string P_VBT_PBTHDRAFT_A, string P_VBT_PDPTDRAFT
                 , string P_VBT_PDPTDRAFT_P, string vVBT_PDPTDRAFT_A, string P_VBT_TER_ID, string P_USER_ID, string VBT_ID, string P_VBT_LDUNLDFG);
        /// <summary>
        /// 增加修改航次表  P_Operation_Type为1是新增，2是修改
        /// </summary>
        /// <param name="P_Operation_Code"></param>
        /// <param name="P_VOY_ID"></param>
        /// <param name="P_User_ID"></param>
        /// <param name="P_VOY_IEFG"></param>
        /// <param name="P_VOY_SLN_ID"></param>
        /// <param name="P_SCD_ID"></param>
        /// <param name="P_VOY_FLT_ID"></param>
        /// <param name="P_VOY_VOYAGE"></param>
        /// <param name="P_VOY_INTRADE"></param>
        /// <returns></returns>
        [OperationContract]
        string InsertUpdateProcessVoyage(int P_Operation_Code, int P_VOY_ID, int P_User_ID,
        string P_VOY_IEFG, int P_VOY_SLN_ID, int P_SCD_ID, int P_VOY_FLT_ID, string P_VOY_VOYAGE,
        string P_VOY_INTRADE);

        /// <summary>
        /// 增加 修改 箱表 P_Operation_Type为1是新增，2是修改。
        /// </summary>
        /// <param name="P_Operation_Type"></param>
        /// <param name="P_VOY_ID"></param>
        /// <param name="P_CSZ_CSIZECD"></param>
        /// <param name="P_STS_CSTATUSCD"></param>
        /// <param name="P_DNGFG"></param>
        /// <param name="P_OVLMTCD"></param>
        /// <param name="P_RFFG"></param>
        /// <param name="P_AMOUNT"></param>
        /// <param name="P_USER_ID"></param>
        /// <param name="P_EFFG"></param>
        /// <param name="P_VAT_ID"></param>
        /// <returns></returns>
        [OperationContract]
        string InsertUpdateProcessCTNAmount(int P_Operation_Type, string P_VOY_ID, string P_CSZ_CSIZECD,
           string P_STS_CSTATUSCD, string P_DNGFG, string P_OVLMTCD, string P_RFFG, string P_AMOUNT, string P_USER_ID
            , string P_EFFG,string P_SCD_ID, string P_VAT_ID);

        /// <summary>
        /// 增加 修改 货物表 P_Operation_Type为1是新增，2是修改。
        /// </summary>
        /// <param name="P_Operation_Type"></param>
        /// <param name="P_VOY_ID"></param>
        /// <param name="P_VAG_GTYPECD"></param>
        /// <param name="P_VAG_PKG"></param>
        /// <param name="P_VAG_TON"></param>
        /// <param name="P_VAG_VOL"></param>
        /// <param name="P_VAG_REMARK"></param>
        /// <param name="P_USER_ID"></param>
        /// <returns></returns>
        [OperationContract]
        string InsertUpdateProcessCargoAmount(int P_Operation_Type, string P_VOY_ID, string vag_id, string P_VAG_GTYPECD,
           string P_VAG_PKG, string P_VAG_TON, string P_VAG_VOL, string P_VAG_REMARK, string P_USER_ID,string P_SCD_ID);

        /// <summary>
        ///  获取箱尺寸
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<ST_Container_Sizes> GetSTContainerSizes();

        /// <summary>
        ///  获取箱数量
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<ST_Container_Status> GetSTContainerStatus(string txtWhere,string txtOrder);

        /// <summary>
        /// 危类货物等级
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<ST_Dangerous_Cargo_Codes> GetSTDangerousCargoCodes();

        /// <summary>
        /// 批量删除集装箱
        /// </summary>
        /// <param name="mList"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteStVoyageAmounts(List<string> mList);

        /// <summary>
        /// 批量删除散货
        /// </summary>
        /// <param name="mList"></param>
        /// <returns></returns>
        [OperationContract]
        bool DeleteProcessCargomount(List<string> mList);

        /// <summary>
        /// 获取港口信息树状图
        /// </summary>
        /// <param name="stText"></param>
        /// <returns></returns>
        [OperationContract]
        List<UM_Ref_Code> GetUmRefCodeTreeView(string strWhere, string strOrder);

        /// <summary>
        /// 得到散货箱量
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="strOrder"></param>
        /// <returns></returns>
        [OperationContract]
        List<ST_VOYAGE_CARGO_AMOUNTS> GetStVoyageCargoAmounts(string strWhere,string strOrder);


        #region add by hwl

        /// <summary>
        /// 获取航班船信息
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="strOrder"></param>
        /// <returns></returns>
        [OperationContract]
        List<WEB_VM_LINERS> GetVMLines(string strWhere, string strOrder);


        /// <summary>
        /// 获取航班信息
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="strOrder"></param>
        /// <returns></returns>
        [OperationContract]
        List<WEB_VM_FLIGHTS> GetFlights(string strWhere, string strOrder);




        /// <summary>
        /// 执行航班的增加、删除、修改操作
        /// </summary>
        /// <param name="operationType"></param>
        /// <param name="userID"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        string IUDForFlight(int operationType, int userID, WEB_VM_FLIGHTS model);



        /// <summary>
        /// 根据用户ID获取船代理ID
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        [OperationContract]
        string GetAgentIDByUserID(int userID);


        /// <summary>
        /// 执行航班船的增加、修改、删除操作
        /// </summary>
        /// <param name="operationType"></param>
        /// <param name="userID"></param>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract]
        string IUDForVessel(int operationType, int userID, WEB_VM_LINERS model);

        /// <summary>
        /// 获得班期配置表
        /// </summary>
        /// <returns></returns>
         [OperationContract]
        List<string> GetFltSchedule();
      
        #endregion

    }


    public class MainSeaRoutes
    {
        public int ID { get; set; }
        public string RTCD { get; set; }
        public string RouteName { get; set; }
        public string ChildRouteName { get; set; }
        public string CST_CSTM { get; set; }
    }

}
